<!DOCTYPE html>
<html>
<title>Test that removing a video that is acting as audio does not crash</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../media-controls.js"></script>
<video controls preload=metadata>
  <source src="../content/test.oga" />
</video>
<script>
async_test(t => {
  const video = document.querySelector('video');

  video.addEventListener('loadedmetadata', t.step_func_done(() => {
    video.src=null;
    video.parentNode.removeChild(video);
  }));

});
</script>
</html>
